package cn.zyb.pet.domain;

import java.math.BigDecimal;
import java.util.Date;
import cn.zyb.basic.domain.BaseDomain;
import cn.zyb.org.domain.Shop;
import cn.zyb.user.domain.User;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

/**
 * 实体类：
 */
@Data
public class Pet extends BaseDomain{

  private String name;
  private BigDecimal costprice;
  private BigDecimal saleprice;
  /**
   * 类型id
   */
  private Long typeId;
  //宠物类型对象 - 类型的名称
  private PetType petType;
  private String resources;
  /**
   * 状态：0下架 1上架
   */
  private Integer state;
  @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
  private Date offsaletime;
  @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
  private Date onsaletime;
  @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
  private Date createtime = new Date();
  /**
   * 宠物所在的店铺的id
   */
  private Long shopId;
  //所属店铺对象
  private Shop shop;
  /**
   * 领养该宠物的用户id
   */
  private Long userId;
  //领养人对象：如果有领养人了这个宠物应该是下架
  private User user;
  /**
   * 宠物2种来源：
   * 1.店铺自己饲养 searchMasterMsgId= null
   * 2.用户发布寻主消息，店铺去收购宠物 - 宠物来自于这一条寻主消息
   */
  private Long searchMasterMsgId;

  //保存当前宠物的详情
  private PetDetail petDetail;



}
